package at.ac.tuwien.dse.health.event.listener;

import at.ac.tuwien.dse.health.event.annotation.Observe;
import at.ac.tuwien.dse.health.event.bus.EventTarget;
import at.ac.tuwien.dse.health.event.type.Event;

import java.io.Serializable;

/**
 * Common interface for notifying subscribers for certain events.
 *
 * @author Bernhard Nickel
 * @author Gregor Schauer
 * @author Dominik Strasser
 */
public interface EventListener {
	/**
	 * Handles the given event of a certain type subscribed by a certain target.
	 *
	 * @param eventTarget the subscriber to notify
	 * @param event       the event
	 */
	@Observe
	void handleEvent(EventTarget eventTarget, Event<? extends Serializable> event);
}
